//
//  DFHomeTitleButton.swift
//  FlyBlog
//
//  Created by FEI on 16/4/13.
//  Copyright © 2016年 FEI. All rights reserved.
//

import UIKit

class DFHomeTitleButton: UIButton {

    init(title: String) {
        super.init(frame: CGRectZero)
        self.setTitle(title, forState: UIControlState.Normal)
        self.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        self.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        self.sizeToFit()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("")
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel?.frame.origin.x = 0
        imageView?.frame.origin.x = titleLabel!.frame.width + 3
    }

}
